package br.com.basili.mb;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import br.com.basili.dao.CharacterizationDAO;
import br.com.basili.dao.ProtocoloDAO;
import br.com.basili.entity.Characterization;
import br.com.basili.entity.Context;
import br.com.basili.entity.Study;

@RequestScoped
@ManagedBean
public class CharacterizationMB
{
	private Characterization characterization;
	
	private Study[] listaTiposEstudo;
	
	private Context[] listaContexto;
	
//	public CharacterizationMB() 
//	{ 
////		listaTiposEstudo = Study.values();
////		listaContexto = Context.values();
////		characterization = new Characterization();
//		characterization.setStudy(Study.CASE_STUDY);
//	}

	public Characterization getCharacterization() {
		return characterization;
	}

	public void setCharacterization(Characterization characterization) {
		this.characterization = characterization;
	}

	public Study[] getListaTipos() {
		return listaTiposEstudo;
	}

	public void setListaTipos(Study[] listaTipos) {
		this.listaTiposEstudo = listaTipos;
	}

	public Context[] getListaContexto() {
		return listaContexto;
	}

	public void setListaContexto(Context[] listaContexto) {
		this.listaContexto = listaContexto;
	}
	
	public String voltar(){
		return "Identification.jsf?faces-redirect=true";
	}
	
	public String salvar(){
		CharacterizationDAO dao = new CharacterizationDAO();
		try {
			dao.salvar(characterization);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "introduction";
	}
	
}